using System;

namespace Copperline.Escriba
{
	/// <summary>
	/// Summary description for IdentLogEntry.
	/// </summary>
	[Serializable]
	public class IdentLogEntry : LogEntry
	{
		/// <summary>
		/// Constructs a new instance of the IdentLogEntry class
		/// </summary>
		/// <param name="ile">an IdentLogEntry to copy from</param>
		public IdentLogEntry( IdentLogEntry ile )
			: base( ile )
		{
			this.ident = ile.ident;
			this.parent = ile.parent;
		}
		/// <summary>
		/// Constructs a new instance of the IdentLogEntry class
		/// </summary>
		/// <param name="entry">the log entry</param>
		/// <param name="ident">identification string, such as a session id</param>
		/// <param name="parent">the parent marker</param>
		public IdentLogEntry( string entry, string ident, string parent )
			: base( entry )
		{
			this.ident = ident;
			this.parent = parent;
		}
		/// <summary>
		/// Constructs a new instance of the IdentLogEntry class
		/// </summary>
		/// <param name="entry">the log entry</param>
		/// <param name="ident">identification string</param>
		/// <param name="parent">parent marker</param>
		/// <param name="severity">severity of the log event</param>
		public IdentLogEntry( string entry, string ident, string parent, ESeverity severity )
			: base( entry, severity )
		{
			this.ident = ident;
			this.parent = parent;
		}

		private string ident;
		/// <summary>
		/// Sets or gets the identifier string
		/// </summary>
		public string Ident
		{
			get { return ident; }
			set { ident = value; }
		}

		private string parent;
		/// <summary>
		/// Sets or gets the parent marker
		/// </summary>
		public string ParentId
		{
			get { return parent; }
			set { parent = value; }
		}

		private static string identFormat = "{0}";
		/// <summary>
		/// Sets or gets the formatting string to apply to the identifier
		/// </summary>
		public static string IdentFormat
		{
			get { return identFormat; }
			set { identFormat = value; }
		}

		private static string parentIdFormat = "{0}";
		/// <summary>
		/// Sets or gets the formatting string to apply to the parent marker
		/// </summary>
		public static string ParentIdFormat
		{
			get { return parentIdFormat; }
			set { parentIdFormat = value; }
		}
	}
}
